{{ csrf_field() }}
<div class="box-body">

    @if( isset($permissionsList) )
        <div class="form-group">
            <label>上级权限</label>
            <select name="pid" class="form-control">
                @if( isset($permission ))
                    <option value="0" {{ 0 == $permission->pid ? 'selected="selected"' : '' }} >请选择</option>
                @else
                    <option value="0">请选择</option>
                @endif

                @foreach($permissionsList as $permissiond)
                    @if( isset($permission ))
                        <option {{ $permissiond['id'] == $permission->pid ? 'selected' : '' }} value="{{ $permissiond['id'] }}">{{ $permissiond['cn_name'] }}</option>
                    @else
                        <option value="{{ $permissiond['id'] }}">{{ $permissiond['cn_name'] }}</option>
                    @endif
                @endforeach
            </select>
        </div>
    @endif
    <div class="form-group">
        <label for="name">权限标识</label>
        <input type="text" name="name" value="{{ $permission->name or old('name') }}" class="form-control" id="name" placeholder="权限标识">
    </div>
    <div class="form-group">
        <label for="cn_name">权限名</label>
        <input type="text" name="cn_name" value="{{ $permission->cn_name or old('cn_name') }}" class="form-control" id="cn_name" placeholder="权限名">
    </div>

</div>
<div class="box-footer">
    <button type="submit" class="btn btn-primary">保存</button>
    <button type="button" onclick="javascript:window.history.back()" class="btn btn-default">返回</button>
</div>